<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInLeft">
        <!--<div th:if="${tag}==0">
            <div data-th-replace="common/functionDepict"></div>
        </div>-->
        <div>
            <div class="row">
                <div class="pt10">
                    <div class="col-sm-9">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>选择要创建的素材类型</h5>
                            </div>
                            <div class="ibox-content clearfix pt10">
                                <p class="c-red" th:if="${isCustomerKey}==null or  ${isLive}==null">
                                    &nbsp;&nbsp;&nbsp;*平台检测到您还未开通云视频服务
                                    <span th:if="${isCustomerKey}==null" th:text="'，中的录播服务'"></span>
                                    <span th:if="${isLive}==null" th:text="${customerKey}==null?'、录播服务':'，中的直播服务'"></span>
                                    ，开通后才可使用
                                    <span th:if="${isCustomerKey}==null" th:text="${isLive}==null?'录播服务、':'录播服务。'"></span>
                                    <span th:if="${isLive}==null" th:text="'直播服务。'"></span>
                                    <button onclick="getRedirectMenu('/admin/course/serviceConfig',false)" type="button" class="btn btn-outline btn-primary">点击开通</button>
                                </p>
                                <div class="creat-mod-list">
                                    <div class="clearfix">
                                        <div class="iv-data-item">
                                            <a th:class="(${isLive}==null)?'openService create-material':'create-material'" th:attrappend="data-url=@{/admin/course/material/initAdd?typeKey=LIVE&tag={tag}&mouldId={mouldId}&courseId={courseId}(tag=${tag},mouldId=${mouldId},courseId=${courseId})}">
                                                <div class="iv-data-item-bx iv-data-item-bx-6">
                                                    <aside class="iv-data-icon"><span class="fs24 c-fff"><i class="fa fa-file-video-o"></i></span></aside>
                                                    <div class="text-right">
                                                        <h3><span class="c-fff fs24">直播</span></h3>
                                                        <div class="c-fff"><small class="fs12 ml5">直播类型的素材，内置云服务直播服务</small></div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="iv-data-item">
                                            <a href="javascript:void(0);" class="create-material" th:attrappend="data-url=@{/admin/course/material/initAdd?typeKey=VIDEO&tag={tag}&mouldId={mouldId}&courseId={courseId}(tag=${tag},mouldId=${mouldId},courseId=${courseId})}">
                                                <div class="iv-data-item-bx iv-data-item-bx-4">
                                                    <aside class="iv-data-icon"><span class="fs24 c-fff"><i class="fa fa-file-video-o"></i></span></aside>
                                                    <div class="text-right">
                                                        <h3><span class="c-fff fs24">视频</span></h3>
                                                        <div class="c-fff"><small class="fs12 ml5">视频类型的素材，内置云服务视频服务</small></div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="iv-data-item">
                                            <a href="javascript:void(0);" class="create-material" th:attrappend="data-url=@{/admin/course/material/initAdd?typeKey=AUDIO&tag={tag}&mouldId={mouldId}&courseId={courseId}(tag=${tag},mouldId=${mouldId},courseId=${courseId})}">
                                                <div class="iv-data-item-bx iv-data-item-bx-5">
                                                    <aside class="iv-data-icon"><span class="fs24 c-fff"><i class="fa fa-file-sound-o"></i></span></aside>
                                                    <div class="text-right">
                                                        <h3><span class="c-fff fs24">音频</span></h3>
                                                        <div class="c-fff"><small class="fs12 ml5">音频类型的素材，内置云服务音频服务</small></div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="iv-data-item">
                                            <a href="javascript:void(0);" class="create-material" th:attrappend="data-url=@{/admin/course/material/initAdd?typeKey=ARTICLE&tag={tag}&mouldId={mouldId}&courseId={courseId}(tag=${tag},mouldId=${mouldId},courseId=${courseId})}">
                                                <div class="iv-data-item-bx iv-data-item-bx-2">
                                                    <aside class="iv-data-icon"><span class="fs24 c-fff"><i class="fa fa-file-word-o"></i></span></aside>
                                                    <div class="text-right">
                                                        <h3><span class="c-fff fs24">文章</span></h3>
                                                        <div class="c-fff"><small class="fs12 ml5">知识文章类型素材类型</small></div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div data-th-replace="common/importantNotes"></div>
                </div>
            </div>
        </div>
    </div>
    <div data-th-replace="layout/head-footer"></div>
<script th:inline="javascript">
    var tag = [[${tag}]];
    $("body").on("click",".openService",function(){
        icModale(2, "系统检测到平台还未开通云服务，是否去开通？", 3, function () {
            getRedirectMenu('/admin/course/serviceConfig',false)
        });
    }).on("click",".create-material",function () {
        let url = $(this).data("url");
        if(tag==1){
            window.location.href=url;
        }else{
            parent.getRedirectMenu(url,false);
            parent.layer.closeAll();
        }
    });
</script>
</body>
</html>
